<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="js/bootstrap/css/bootstrap.css"/>
</head>
<body>
<div class="container">
    <ol class="breadcrumb">
        <li><a href="#">学生成绩管理系统</a></li>
        <li><a href="QueryScore.html">学生反馈</a></li>
        <li>成绩修改申请列表</li>
    </ol>
    <h3 class="page-header">历史申请记录</h3>
    <table class="table table-striped table-bordered">
        <tr>
            <th>学生学号</th>
            <th>课程名</th>
            <th>成绩</th>
            <th>修改原因</th>
        </tr>
        <tr v-for="(feedback,index) in datalist">
            <td>{{feedback.feedbackSno}}</td>
            <td>{{feedback.feedbackCname}}</td>
            <td>{{feedback.feedbackScore}}</td>
            <td>{{feedback.feedbackRs}}</td>
        </tr>
    </table>
    <h3 class="page-header">成绩修改申请列表</h3>

    <table class="table table-striped table-bordered">
        <tr>
            <th>学生学号</th>
            <th>课程名</th>
            <th>成绩</th>
            <th>修改原因</th>
            <th>是否修改</th>
        </tr>
        <tr v-for="(feedback,index) in datalist2">
            <td>{{feedback.feedbackSno}}</td>
            <td>{{feedback.feedbackCname}}</td>
            <td>{{feedback.feedbackScore}}</td>
            <td>{{feedback.feedbackRs}}</td>
            <td>
                <input type="button" value="已修改" class="btn btn-primary btn-sm" @click="updateFeedback(feedback.feedbackId)">
            </td>
        </tr>

    </table>
</div>
<script src="js/vue/vue2.5.js"></script>
<script src="js/vue/axios.min.js"></script>
<script src="js/jquery.js"></script>
<script src="js/layer/layer.js"></script>
<script>
    new Vue({
        el:'.container',
        data:{
            datalist:[],
            datalist2:[]
        },
        methods:{
            //查询成绩列表
            queryFeedback(){
                axios.get('/feedback/query',{params:{feedbackCh:0}})
                    .then(resp =>{//请求成功的回调函数
                        this.datalist2 = resp.data;
                    })
            },
            queryFeedback2(){
                axios.get('/feedback/query',{params:{feedbackCh:1}})
                    .then(resp =>{//请求成功的回调函数
                        this.datalist = resp.data;
                    })
            },
            updateFeedback(feedbackId){
                axios.get('/feedback/update',{params:{feedbackId:feedbackId}})
                    .then(resp =>{//请求成功的回调函数
                        layer.msg('已修改！');
                        setTimeout(()=>{
                            location.href='UpdateFeedback.html';
                        },500);
                    })
            }
        },
        mounted(){
          this.queryFeedback();
          this.queryFeedback2();
        }
    })
</script>
</body>
</html>